<template>
    <div class="detail_r">
        <div class="hot_list">
            <h3 class="title">
                <span>更多节目</span>
                <a class="more" @click="$router.push(`/djradio/${radioId}`)">全部&gt;</a>
            </h3>
            <ul>
                <li v-for="item in programs" :key="item.id">
                    <img :src="item.coverUrl" alt="" @click="$router.push(`/program/${item.id}`)">
                    <div class="info">
                        <h4 :title="item.name" class="ellipsis" @click="$router.push(`/program/${item.id}`)">{{ item.name }}</h4>
                        <p class="band">
                            <i class="by">Vol.</i>
                            <i class="name">{{ item.serialNum }}</i> 
                        </p>
                    </div>
                </li>
            </ul>
        </div>
        <div class="more">
            <h3 class="title">
                <span>了解更多 &gt;&gt;</span>
            </h3>
            <ul class="bg">
                <li><a class="ios"></a></li>
                <li><a class="pc"></a></li>
                <li><a class="aos"></a></li>
            </ul>
            <p>同步歌单，随时畅听320k好音乐</p>
        </div>
    </div>
</template>

<script>
import { ProgramDetailApi, DjProgramOldApi } from "@/request/api";
export default {
    data () {
        return {
            programList: [],
            programs: [],
            radioId: 0,
        }
    },
    computed: {
        id() {
            return this.$route.params.id;
        }
    },
    created() {
        ProgramDetailApi(this.id).then((res) => {
            // console.log(res);
            this.radioId = res.data.program.radio.id;
            DjProgramOldApi(this.radioId).then((res) => {
                // console.log(res);
                this.programs = res.data.programs.slice(0, 5);
            })
        })
    },
}
</script>
 
<style lang = "less" scoped>
@import "../../assets/base";
.detail_r {
    width: 240px;
    background-color: #fff;
    border-right: 1px solid #D7D7D7;
    border-left: 1px solid #D7D7D7;
    padding: 40px 20px;
    .hot_list {
        padding: 0 0 20px;
        .title {
            border-bottom: 1px solid #ccc;
            margin-bottom: 20px;
            padding-bottom: 10px;
            display: flex;
            justify-content: space-between;
            span {
                color: #333;
                font-size: 12px;
                font-weight: bold;
            }
            .more {
                font-size: 12px;
                color: #666;
                &:hover {
                    cursor: pointer;
                    text-decoration: underline;
                }
            }
        }
        ul {
            li {
                width: 200px;
                height: 50px;
                display: flex;
                margin: 0 0 15px;
                img {
                    cursor: pointer;
                    width: 50px;
                    height: 50px;
                }
                .info {
                    height: 50px;
                    display: flex;
                    flex-direction: column;
                    justify-content: space-evenly;
                    margin-left: 10px;
                    h4 {
                        width: 140px;
                        font-size: 14px;
                        &:hover {
                            cursor: pointer;
                            text-decoration: underline;
                        }
                    }
                    .band {
                        display: flex;
                        font-size: 12px;
                        .by {
                            color: #999;
                            margin: 0 5px 0 0;
                        }
                        .name {
                            color: #999;
                        }
                    }
                    
                }
            }
        }
    }
    .more {
        .title {
            border-bottom: 1px solid #ccc;
            margin-bottom: 20px;
            padding-bottom: 10px;
            span {
                color: #333;
                font-size: 12px;
                font-weight: bolder;
            }
        }
        .bg {
            height: 48px;
            display: flex;
            align-content: center;
            justify-content: space-between !important;
            margin-bottom: 20px;
            .ios {
                width: 42px;
                height: 48px;
                display: block;
                background: url("@/assets/images/public/sprite.png");
                background-position: 0 -392px;
                &:hover {
                    cursor: pointer;
                    background-position: 0 -472px;
                }
            }
            .pc {
                width: 60px;
                height: 48px;
                display: block;
                background: url("@/assets/images/public/sprite.png");
                background-position: -72px -392px;
                &:hover {
                    cursor: pointer;
                    background-position: -72px -472px;
                }
            }
            .aos {
                width: 42px;
                height: 48px;
                display: block;
                background: url("@/assets/images/public/sprite.png");
                background-position: -163px -392px;
                &:hover {
                    cursor: pointer;
                    background-position: -163px -472px;
                }
            }
        }
        p {
            font-size: 12px;
            color: #999;
        }
    }
}
</style>